package com.hgshop.yudongyang.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.hgshop.yudongyang.domain.Spec;
import com.hgshop.yudongyang.domain.SpecOption;

public interface SpecMapper {

	
	List<Spec> specList();

	int specdels(Integer[] ids);

	void addSpec(Spec spec);

	void addSpecOntion(@Param("id")Integer id, @Param("optionList")List<SpecOption> optionList);

	@Delete("delete from hg_spec_option where spec_id=#{id}")
	void delSpecOption(Integer id);

	@Delete("delete from hg_spec where id=#{id}")
	void delSpec(Integer id);

	//去修改
	Spec getOne(Integer id);

	@Update("update hg_spec set spec_name=#{specName} where id=#{id}")
	void updateSpec(Spec spec);

	@Delete("delete from hg_spec_option where spec_id=#{id}")
	void deleteOption(Integer id);

	@Select("select * from hg_spec_option where spec_id=#{id}")
	List<SpecOption> findSpecOptionById(Integer id);

	List<Spec> findSpecBySkuId(Integer id);
}
